<html>
<script src="http://apps.bdimg.com/libs/jquery/1.11.1/jquery.min.js"
	type="text/javascript"></script>
<meta charset="utf-8" />
<script type="text/javascript">
	function ajaxupload(id) {
		var form = new FormData(document.getElementById("form"));
		$.ajax({
			url : "/upload/doc",
			type : "post",
			data : form,
			cache : false,
			processData : false,
			contentType : false,
			success : function(data) {
				if (data == '' || typeof (data) == "undefined"
						|| data.indexOf("Exception:") > 0) {
					alert("上传失败！" + data);
				} else {
					location.reload(false);
				}
			},
			error : function(e) {
				alert("网络错误，请重试！！");
			}
		});
	}
</script>

<h1>文档目录</h1>
<div class="table_box">
	<#list page.getList() as x> <a href="javascript:void(0)"
		onclick="return changePage('${ProjectName!}/onlinedoc/file?filename=${x}')">${x}</a></br>
	</#list> <br> <br>
	<form id="form" action="${ProjectName!}/upload/doc"
		enctype="multipart/form-data" method="post">
		<input type="file" name="file" accept=".html" /> <input type="button"
			onclick="ajaxupload()" value="上传" />
	</form>
	<form action="${ProjectName!}/onlinedoc/search" method="get">
		<input type="text" maxlength="100" autocomplete="on" name="q"
			value="" /> <input type="submit" value="搜索一下" />
	</form>
</div>
<script>
	function changePage(data) {
		parent.parentChangePage(data);
	}
</script>
</html>